<template>
  <el-container class="not-found-container">
    <el-main class="content">
      <el-result icon="error" title="404 - 页面未找到" sub-title="抱歉，您访问的页面不存在或已被移除。">
        <template #extra>
          <el-button type="primary" @click="goHome">返回首页</el-button>
          <el-button @click="goBack">返回上一页</el-button>
        </template>
      </el-result>
      <div class="illustration">
        <!-- You can add a relevant illustration SVG or image here -->
        <img src="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg" alt="Page not found" style="max-width: 300px;"/>
      </div>
    </el-main>
  </el-container>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push({ name: 'Home' });
};

const goBack = () => {
  router.go(-1); // Go back to the previous page in history
};
</script>

<style scoped>
.not-found-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px); /* Adjust based on your header/footer height */
  text-align: center;
  padding: 20px;
}

.content {
  max-width: 600px;
}

.el-result {
  padding: 20px 0;
}

.illustration {
  margin-top: 30px;
}
</style> 